using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using SIGCBI.Entities;

namespace SIGCBI.Repository.Mapping
{
    public class SEXOMap : EntityTypeConfiguration<SEXO>
    {
        public SEXOMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            this.Property(p => p.ID).
                HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            // Properties
            this.Property(t => t.Descripcion)
                .IsRequired()
                .HasMaxLength(15);

            // Table & Column Mappings
            this.ToTable("SEXO");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.Descripcion).HasColumnName("Descripcion");
        }
    }
}
